<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <title>待发货</title>
     <link rel="icon" href="/assets/img/favicon.ico">

    <link rel="stylesheet" type="text/css" href="/css/webbase.css" />
    <link rel="stylesheet" type="text/css" href="/css/pages-seckillOrder.css" />
</head>/

<body>
   
	<!--页面顶部白条条，由js动态加载-->
	<script type="text/javascript" src="/plugins/jquery/jquery.min.js"></script>
	<div class="nav-bottom"></div>
    <script type="text/javascript">$(".nav-bottom").load("top.html");</script>

<script type="text/javascript" src="/js/plugins/jquery/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
	$("#service").hover(function(){
		$(".service").show();
	},function(){
		$(".service").hide();
	});
	$("#shopcar").hover(function(){
		$("#shopcarlist").show();
	},function(){
		$("#shopcarlist").hide();
	});

})
</script>
<script type="text/javascript" src="/js/plugins/jquery.easing/jquery.easing.min.js"></script>
<script type="text/javascript" src="/js/plugins/sui/sui.min.js"></script>
<script type="text/javascript" src="/js/plugins/jquery-placeholder/jquery.placeholder.min.js"></script>
<script type="text/javascript" src="/js/widget/nav.js"></script>
</body>
    <!--header-->
    <div id="account">
        <div class="py-container">
            <div class="yui3-g home">
                <!--左侧列表-->
                <div th:replace="~{home-top::home-left}"></div>
               <!-- <div class="yui3-u-1-6 list">

                    <div class="person-info">
                        <div class="person-photo"><img src="/img/_/photo.png" alt=""></div>
                        <div class="person-account">
                            <span class="name">Michelle</span>
                            <span class="id" style="display: none"></span>
                            <span class="safe">账户安全</span>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <div class="list-items">
                        <dl>
							<dt><i>·</i> 订单中心</dt>
							<dd><a href="/home/index"  >我的订单</a></dd>
							<dd><a href="/home/order/pay" >待付款</a></dd>
							<dd><a href="/home/order/send" class="list-active">待发货</a></dd>
							<dd><a href="/home/order/receive" >待收货</a></dd>
							<dd><a href="/home/order/evaluate"  >待评价</a></dd>
						</dl>
						<dl>
							<dt><i>·</i> 我的中心</dt>
							<dd><a href="home-person-collect.html">我的收藏</a></dd>
							<dd><a href="home-person-footmark.html">我的足迹</a></dd>
						</dl>
						<dl>
							<dt><i>·</i> 物流消息</dt>
						</dl>
						<dl>
							<dt><i>·</i> 设置</dt>
							<dd><a href="/home/setting/info">个人信息</a></dd>
							<dd><a href="/home/setting/address">地址管理</a></dd>
							<dd><a href="/home/setting/safe" >安全管理</a></dd>
						</dl>
                    </div>
                </div>-->
                <!--右侧主内容-->
                <div class="yui3-u-5-6 order-pay">
                    <div class="body">
                        <div class="table-title">
                            <table class="sui-table  order-table">
                                <tr>
                                    <thead>
                                        <th width="35%">宝贝</th>
                                        <th width="5%">单价</th>
                                        <th width="5%">数量</th>
                                        <th width="8%">商品操作</th>
                                        <th width="10%">实付款</th>
                                        <th width="10%">交易状态</th>
                                        <th width="10%">交易操作</th>
                                    </thead>
                                </tr>
                            </table>
                        </div>
                        <div class="order-detail">
                            <div class="orders">
                                <div class="choose-order">
                                    <div class="sui-pagination pagination-large top-pages">
                                        <ul>
                                            <li class="prev disabled"><a href="#">上一页</a></li>

                                            <li class="next"><a href="#">下一页</a></li>
                                        </ul>
                                    </div>
                                </div>
                                <!--order1-->
                                <!--<div class="choose-title">
                                    <label data-toggle="checkbox" class="checkbox-pretty ">
                                           <input type="checkbox" checked="checked"><span>2017-02-11 11:59　订单编号：7867473872181848  店铺：哇哈哈 <a>和我联系</a></span>
                                     </label>
                                    <a class="sui-btn btn-info share-btn">分享</a>
                                </div>-->
                                <!--<table class="sui-table table-bordered order-datatable">
                                    <tbody>
                                        <tr>
                                            <td width="35%">
                                                <div class="typographic"><img src="img/goods.png" />
                                                    <a href="#" class="block-text">包邮 正品玛姬儿压缩面膜无纺布纸膜100粒 送泡瓶面膜刷喷瓶 新款</a>
                                                    <span class="guige">规格：温泉喷雾150ml</span>
                                                </div>
                                            </td>
                                            <td width="5%" class="center">
                                                <ul class="unstyled">
                                                    <li class="o-price">¥599.00</li>
                                                    <li>¥299.00</li>
                                                </ul>
                                            </td>
                                            <td width="5%" class="center">1</td>
                                            <td width="8%" class="center">
                                                <ul class="unstyled">
                                                    <li>已发货</li>
                                                    <li><a>退货/退款</a></li>
                                                </ul>
                                            </td>
                                            <td width="10%" class="center" rowspan="2">
                                                <ul class="unstyled">
                                                    <li>¥299.00</li>
                                                    <li>（含运费：￥0.00）</li>
                                                </ul>
                                            </td>
                                            <td width="10%" class="center" rowspan="2">
                                                <ul class="unstyled">
                                                    <li>部分发货</li>
                                                    <li><a href="orderDetail.html" class="btn">订单详情 </a></li>
                                                </ul>
                                            </td>
                                            <td width="10%" class="center" rowspan="2">
                                                <ul class="unstyled">
                                                    <li>还剩4天23时</li>
                                                    <li><a href="#" class="sui-btn btn-info">确认发货</a></li>
                                                </ul>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="35%">
                                                <div class="typographic"><img src="img/goods.png" />
                                                    <a href="#" class="block-text">包邮 正品玛姬儿压缩面膜无纺布纸膜100粒 送泡瓶面膜刷喷瓶 新款</a>
                                                    <span class="guige">规格：温泉喷雾150ml</span>
                                                </div>
                                            </td>
                                            <td width="5%" class="center">
                                                <ul class="unstyled">
                                                    <li class="o-price">¥199.00</li>
                                                    <li>¥212.00</li>
                                                </ul>
                                            </td>
                                            <td width="5%" class="center">1</td>
                                            <td width="8%" class="center">
                                                <ul class="unstyled">
                                                    <li>未发货</li>
                                                    <li><a>退货/退款</a></li>
                                                </ul>
                                            </td>


                                        </tr>

                                    </tbody>
                                </table>-->

                                <!--order2--><!--
                                <div class="choose-title">
                                    <label data-toggle="checkbox" class="checkbox-pretty ">
                                           <input type="checkbox" checked="checked"><span>2017-02-11 11:59　订单编号：7867473872181848  店铺：哇哈哈 <a>和我联系</a></span>
                                     </label>
                                    <a class="sui-btn btn-info share-btn">分享</a>
                                </div>
                                <table class="sui-table table-bordered order-datatable">
                                    <tbody>
                                        <tr>
                                            <td width="35%">
                                                <div class="typographic"><img src="img/goods.png" />
                                                    <a href="#" class="block-text">包邮 正品玛姬儿压缩面膜无纺布纸膜100粒 送泡瓶面膜刷喷瓶 新款</a>
                                                    <span class="guige">规格：温泉喷雾150ml</span>
                                                </div>
                                            </td>
                                            <td width="5%" class="center">
                                                <ul class="unstyled">
                                                    <li class="o-price">¥599.00</li>
                                                    <li>¥299.00</li>
                                                </ul>
                                            </td>
                                            <td width="5%" class="center">1</td>
                                            <td width="8%" class="center">
                                                <ul class="unstyled">

                                                    <li><a>退货/退款</a></li>
                                                </ul>
                                            </td>
                                            <td width="10%" class="center">
                                                <ul class="unstyled">
                                                    <li>¥299.00</li>
                                                    <li>（含运费：￥0.00）</li>
                                                </ul>
                                            </td>
                                            <td width="10%" class="center">
                                                <ul class="unstyled">
                                                    <li>买家已付款</li>
                                                    <li><a href="orderDetail.html" class="btn">订单详情 </a></li>
                                                </ul>
                                            </td>
                                            <td width="10%" class="center">
                                                <ul class="unstyled">
                                                    <li><a href="#" class="sui-btn btn-info">提醒发货</a></li>
                                                </ul>
                                            </td>
                                        </tr>


                                    </tbody>
                                </table>-->
                            </div>
                            <div class="choose-order">

                                <div class="sui-pagination pagination-large top-pages">
                                    <ul>
                                        <li class="prev disabled"><a  class="previousPage">«上一页</a></li>
                                        <li class="active"><a href="#" class="pageIndex">1</a></li>
                                        <li class="dotted"><span>...</span></li>
                                        <li class="next"><a  class="previousPage">下一页»</a></li>
                                    </ul>
                                    <div><span class="totalPages">共10页&nbsp;</span><span>
                                            到
                                            <input type="text" class="page-num"><button class="page-confirm" onclick="alert(1)">确定</button>
                                            页</span></div>
                                </div>
                            </div>
                            <div class="noneTotalPages" style="display: none"> </div>
                            <div class="clearfix"></div>
                        </div>

                        <div class="like-title">
                            <div class="mt">
                                <span class="fl"><strong>热卖单品</strong></span>
                            </div>
                        </div>
                        <div class="like-list">
                            <ul class="yui3-g">
                                <li class="yui3-u-1-4">
                                    <div class="list-wrap">
                                        <div class="p-img">
                                            <img src="/img/_/itemlike01.png" />
                                        </div>
                                        <div class="attr">
                                            <em>DELL戴尔Ins 15MR-7528SS 15英寸 银色 笔记本</em>
                                        </div>
                                        <div class="price">
                                            <strong>
											<em>¥</em>
											<i>3699.00</i>
										</strong>
                                        </div>
                                        <div class="commit">
                                            <i class="command">已有6人评价</i>
                                        </div>
                                    </div>
                                </li>
                                <li class="yui3-u-1-4">
                                    <div class="list-wrap">
                                        <div class="p-img">
                                            <img src="/img/_/itemlike02.png" />
                                        </div>
                                        <div class="attr">
                                            <em>Apple苹果iPhone 6s/6s Plus 16G 64G 128G</em>
                                        </div>
                                        <div class="price">
                                            <strong>
											<em>¥</em>
											<i>4388.00</i>
										</strong>
                                        </div>
                                        <div class="commit">
                                            <i class="command">已有700人评价</i>
                                        </div>
                                    </div>
                                </li>
                                <li class="yui3-u-1-4">
                                    <div class="list-wrap">
                                        <div class="p-img">
                                            <img src="/img/_/itemlike03.png" />
                                        </div>
                                        <div class="attr">
                                            <em>DELL戴尔Ins 15MR-7528SS 15英寸 银色 笔记本</em>
                                        </div>
                                        <div class="price">
                                            <strong>
											<em>¥</em>
											<i>4088.00</i>
										</strong>
                                        </div>
                                        <div class="commit">
                                            <i class="command">已有700人评价</i>
                                        </div>
                                    </div>
                                </li>
                                <li class="yui3-u-1-4">
                                    <div class="list-wrap">
                                        <div class="p-img">
                                            <img src="/img/_/itemlike04.png" />
                                        </div>
                                        <div class="attr">
                                            <em>DELL戴尔Ins 15MR-7528SS 15英寸 银色 笔记本</em>
                                        </div>
                                        <div class="price">
                                            <strong>
											<em>¥</em>
											<i>4088.00</i>
										</strong>
                                        </div>
                                        <div class="commit">
                                            <i class="command">已有700人评价</i>
                                        </div>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

	<!-- 底部栏位 -->
	<!--页面底部，由js动态加载-->
	<div class="clearfix footer"></div>
	<script type="text/javascript">$(".footer").load("foot.html");</script>
	<!--页面底部END-->
    <script type="text/javascript">
        $.ajax({
            url: "/user/queryName",
            type: "get",
            dataType: "json",
            success: function (s) {
                $(".name").text(s.data.name);
                $(".id").text(s.data.id);
                $(".fixed").text(s.data.phone);
                $(".person-photo").append("<img width='100px' height='100px' src="+s.data.avatar+" alt=\"\">");
            }
        })
        var orderDtoRequest={
            "stat":"DROPSHIP"
        }
        $.ajax({
            url:"/order/details/list",
            type:"get",
            data:orderDtoRequest,
            dataType:"json",
            success:function (s) {
                console.log(s);
                $(".totalPages").text("共"+s.data.totalPage);
                $(".pageIndex").text(s.data.pageIndex);
                $(".noneTotalPages").text(s.data.totalPage);
                $(s.data.orderDetailsDtoResultList).each(function () {
                    let stat ="";
                    let statBehavior="";
                    if (this.state=="DROPSHIP") {
                        stat = "待发货";
                        statBehavior = "催发货";
                    }
                    $(".orders").append("<div class=\"choose-title\">\n" +
                        "<label data-toggle=\"checkbox\" class=\"checkbox-pretty \">\n" +
                        "<input type=\"checkbox\" checked=\"checked\"><span>"+this.createTime+"订单编号:"+this.orderId+"店铺:"+this.shopName+" <a>和我联系</a></span>\n" +
                        "</label>\n" +
                        "<a class=\"sui-btn btn-info share-btn\">分享</a>\n" +
                        "</div>"+
                        "<table class=\"sui-table table-bordered order-datatable\">\n" +
                        "<tbody>\n" +
                        "<tr>\n" +
                        "<td width=\"35%\">\n" +
                        " <div class=\"typographic\"><img width='100px' height='100px' src="+this.goodsImg+" />\n" +
                        "<a href=\"#\" class=\"block-text\">"+this.goodName+"</a>\n" +
                        "</div>\n" +
                        "</td>\n" +
                        "<td width=\"5%\" class=\"center\">\n" +
                        "<ul class=\"unstyled\">\n" +
                        "<li>¥"+this.totalAmount+"</li>\n" +
                        "</ul>\n" +
                        "</td>\n" +
                        "<td width=\"5%\" class=\"center\">"+this.goodsQuantity+"</td>\n" +
                        "<td width=\"8%\" class=\"center\">\n" +
                        "</td>\n" +
                        "<td width=\"10%\" class=\"center\" >\n" +
                        "<ul class=\"unstyled\">\n" +
                        "<li>¥"+this.totalAmount+"</li>\n" +
                        "<li>（含运费：￥0.00）</li>\n" +
                        "</ul>\n" +
                        "</td>\n" +
                        "<td width=\"10%\" class=\"center\">\n" +
                        "<ul class=\"unstyled\">\n" +
                        "<li>"+stat+"</li>\n" +
                        "<form class='foo' action='/order/details' method='get'>" +
                        "<input type='hidden' name='orderId' id='orderDtoRequest' value=>" +
                        "<input type='submit' name='submit' class='submit' id="+this.orderId+" value='订单详情'/>\n" +
                        "</form>" +
                        "</ul>\n" +
                        "</td>\n" +
                        "<td width=\"10%\" class=\"center\">\n" +
                        "<ul class=\"unstyled\">\n" +
                        "<li class="+this.orderId+"><a class='sui-btn btn-info pay' id="+this.id+">"+statBehavior+"</a></li>\n" +
                        "<li>取消订单</li>\n" +
                        "</ul>\n" +
                        "</td>\n" +
                        "</tr>\n" +
                        "</tbody>\n" +
                        "</table>"
                    );
                })
            }
        })
        $(document).on('click','.previousPage',function () {
            let pageIndex=$(".pageIndex").text();
            let totalPages=$(".noneTotalPages").text();
            let firstChild = $(this).text();
            console.log(firstChild);
            if ("«上一页"==firstChild){
                if (pageIndex>=0){
                    alert("不能再往上翻了");
                    return;
                }
                pageIndex--;
            }else if ("下一页»"==firstChild){
                if (pageIndex>=totalPages){
                    alert("不能再往下翻了");
                    return;
                }
                pageIndex++;
            }
            let orderDtoRequest={
                "pageIndex":pageIndex,
                "stat":"DROPSHIP"
            }
            $.ajax({
                url:"/order/details/list",
                type:"get",
                data:orderDtoRequest,
                dataType:"json",
                success:function (s) {
                    console.log(s);
                    $(".orders").children().remove();
                    $(".totalPages").text("共"+s.data.totalPage);
                    $(".pageIndex").text(s.data.pageIndex);
                    $(".noneTotalPages").text(s.data.totalPage);
                    $(s.data.orderDetailsDtoResultList).each(function () {
                        let stat ="";
                        let statBehavior="";
                        if (this.state="DROPSHIP"){
                            stat="待发货";
                            statBehavior="催发货";
                        }
                        $(".orders").append("<div class=\"choose-title\">\n" +
                            "<label data-toggle=\"checkbox\" class=\"checkbox-pretty \">\n" +
                            "<input type=\"checkbox\" checked=\"checked\"><span>"+this.createTime+"订单编号:"+this.orderId+"店铺:"+this.shopName+" <a>和我联系</a></span>\n" +
                            "</label>\n" +
                            "<a class=\"sui-btn btn-info share-btn\">分享</a>\n" +
                            "</div>"+
                            "<table class=\"sui-table table-bordered order-datatable\">\n" +
                            "<tbody>\n" +
                            "<tr>\n" +
                            "<td width=\"35%\">\n" +
                            " <div class=\"typographic\"><img width='100px' height='100px' src="+this.goodsImg+" />\n" +
                            "<a href=\"#\" class=\"block-text\">"+this.goodName+"</a>\n" +
                            "</div>\n" +
                            "</td>\n" +
                            "<td width=\"5%\" class=\"center\">\n" +
                            "<ul class=\"unstyled\">\n" +
                            "<li>¥"+this.totalAmount+"</li>\n" +
                            "</ul>\n" +
                            "</td>\n" +
                            "<td width=\"5%\" class=\"center\">"+this.goodsQuantity+"</td>\n" +
                            "<td width=\"8%\" class=\"center\">\n" +
                            "</td>\n" +
                            "<td width=\"10%\" class=\"center\" >\n" +
                            "<ul class=\"unstyled\">\n" +
                            "<li>¥"+this.totalAmount+"</li>\n" +
                            "<li>（含运费：￥0.00）</li>\n" +
                            "</ul>\n" +
                            "</td>\n" +
                            "<td width=\"10%\" class=\"center\">\n" +
                            "<ul class=\"unstyled\">\n" +
                            "<li>"+stat+"</li>\n" +
                            "<form class='foo' action='/order/details' method='get'>" +
                            "<input type='hidden' name='orderId' id='orderDtoRequest' value=>" +
                            "<input type='submit' name='submit' class='submit' id="+this.orderId+" value='订单详情'/>\n" +
                            "</form>" +
                            "</ul>\n" +
                            "</td>\n" +
                            "<td width=\"10%\" class=\"center\">\n" +
                            "<ul class=\"unstyled\">\n" +
                            "<li class="+this.orderId+"><a href=\"#\" class='sui-btn btn-info pay' id="+this.id+">"+statBehavior+"</a></li>\n" +
                            "<li>取消订单</li>\n" +
                            "</ul>\n" +
                            "</td>\n" +
                            "</tr>\n" +
                            "</tbody>\n" +
                            "</table>"
                        );
                    })
                }
            })
        })
        $(document).on('click', '.submit', function () {

            let prev = $(this).prev();
            let orderId = $(this).attr('id');

            prev.val(orderId);
            let parents = $(this).parents("form");
            $(parents).submit();
            /* $("#ab").click();*/
        })
    </script>
</html>